Validating correctness of expression evaluation within a debugger

ABSTRACT

A method for validating correctness of expression evaluation within a debugger. The method includes determining a statement of interest comprising an expression recognized by a debugger program within one or more source program files of a debuggable program and generating a debug command file for the statement of interest. The method includes inserting a set of debug commands, comprising a first path for a baseline run and a second path for a test run for the statement of interest, into the debug command file, then causing the execution of the baseline run and test run. Results from the baseline run and results from the test run are compared to determine if the results from the baseline run are equivalent to the results from the test run.

FIELD OF THE INVENTION

The present invention relates generally to the field of testing programcode, and more particularly to validating correctness of expressionevaluation within a debugger.

BACKGROUND

A software program includes the data and functions of that program whichare defined in a source code. The source code contains all of theprogramming statements written in a particular programming language.Compilers are tools that read the source code, and subsequently createcomputer-executable output files, usually called object files. Theseoutput files are in a format that can be read by the computer, and causethe computer to perform the indicated tasks.

Debuggers are computer programs that allow computer program developersto find errors in software programs. One method of detecting errors isto stop the execution of a computer program at predetermined points, orbreakpoints. Debuggers may also allow the user to restart a program,track the values of the variables, execute a single-step running of aprogram, and set specific conditions under which the program executionshould be interrupted and control given to the debugger, among otherfunctions.

Debuggers also often support the evaluation of high level languageexpressions as defined by the programming language and supported by thecompiler. The results of the expression evaluation in the debuggershould be identical to the results that are obtained by executing thecompiler-generated code for the same expression. Compilers may encodedebugging information in the object code or in a separate file which,once loaded into a computer memory, may be used to map source variablesto their locations in memory, determine variable types, and map sourcestatements to the compiler-generated instructions in memory.

SUMMARY

Embodiments of the present invention disclose a method, computer programproduct, and computer system for validating correctness of expressionevaluation within a debugger. A computing device determines a statementof interest comprising an expression recognized by a debugger program,within one or more source program files of a debuggable program. Thecomputing device generates a debug command file for the statement ofinterest. The computing device inserts a set of debug commands,comprising a first path for a baseline run and a second path for a testrun, for the statement of interest, into the debug command file. Thecomputing device also causes the execution of the baseline run and testrun. The computing device further compares results from the baseline runand results from the test run to determine if the results from thebaseline run are equivalent to the results from the test run.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS

FIG. 1 is a functional block diagram illustrating a computing device, inaccordance with an embodiment of the present invention.

FIG. 2 is a flowchart depicting operational steps of a debuggervalidation program for validating the correctness of expressionevaluation within a debugger, in accordance with an embodiment of thepresent invention.

FIG. 3A is a flowchart depicting operational steps of a debugger programfor executing a baseline run using debug commands generated fromassignment statements in a debuggable program, in accordance with anembodiment of the present invention.

FIG. 3B is a flowchart depicting operational steps of a debugger programfor executing a test run using debug commands generated from assignmentstatements in a debuggable program, in accordance with an embodiment ofthe present invention.

FIG. 3C is a flowchart depicting operational steps of a debugger programfor executing a baseline run using debug commands generated from IFstatements in a debuggable program, in accordance with an embodiment ofthe present invention.

FIG. 3D is a flowchart depicting operational steps of a debugger programfor executing a test run using debug commands generated from IFstatements in a debuggable program, in accordance with an embodiment ofthe present invention.

FIG. 4 illustrates a representation of the interleaving of thedebuggable program flow when executing a test run using debug commandsgenerated from assignment statements in a debuggable program, inaccordance with an embodiment of the present invention.

FIG. 5A illustrates example text of a COBOL source program filecontaining the statements of interest, MOVE, COMPUTE, ADD, SET, and IF,in accordance with an embodiment of the present invention.

FIG. 5B illustrates example text of a debug command file, generated fromthe COBOL source program file in FIG. 5A, for validating the correctnessof the MOVE, COMPUTE, ADD, and SET commands in a debugger, in accordancewith an embodiment of the present invention.

FIG. 5C illustrates example text of a debug log file produced from abaseline run and a test run for the statements of interest MOVE,COMPUTE, ADD, and SET, in accordance with an embodiment of the presentinvention.

FIG. 5D illustrates example text of a debug command file, generated fromthe COBOL source program file in FIG. 5A, for validating the correctnessof the IF command in a debugger, in accordance with an embodiment of thepresent invention.

FIG. 5E illustrates example text of a debug log file, produced from abaseline run and a test run for the statement of interest IF, inaccordance with an embodiment of the present invention.

FIG. 6 depicts a block diagram of internal and external components of adata processing system, such as the computing device of FIG. 1, inaccordance with an embodiment of the present invention.

DETAILED DESCRIPTION

Debuggers are an important element in the development of a computerprogram, and it is critical that the debugger is functioning properly tohelp pinpoint any problems or errors in the program code beingdeveloped.

The present invention involves a method to help ensure that the debuggeris functioning properly. The evaluation of high level languageexpressions takes place twice, once by executing the compiler-generatedcode for those expressions (under control of the debugger), and once byexecuting equivalent commands supported by the command language of thedebugger. The output of each evaluation is compared to determine whetherthe same results are obtained, indicating that the debugger isfunctioning properly.

This process helps to overcome the difficulties in validatingconsistencies of the evaluation of expressions between a compiler and adebugger, as compilers and debuggers are often each implemented bydifferent development teams or individuals, and each tested usingvarious tools and methodologies. Further, expression evaluation is acomplex process wherein a potentially large number of language rulesmust be followed very precisely, and the complexity increases as moreoperators and data types are supported by a language. When the types areintermixed within an expression, there are rules that must be followedregarding type conversion, decimal point alignment, truncation, and signcorrectness, among others. Despite the efforts of organizations toproduce standards for defining programming languages, such as theAmerican National Standards Institute (ANSI) and the InternationalOrganization for Standardization (ISO), these rules are sometimes subtleand open to interpretation. As a result, there is the potential for thedebugger to yield different expression evaluation results than theexpression evaluation results of the compiler-generated code, and it isdifficult to detect where the discrepancies exist so that they can beresolved.

The present invention will now be described in detail with reference tothe Figures. FIG. 1 is a functional block diagram illustrating acomputing device, designated 120, in accordance with one embodiment ofthe present invention. FIG. 1 provides only an illustration of oneimplementation and does not imply any limitations with regard to theenvironments in which different embodiments may be implemented. Manymodifications to the depicted environment may be made by those skilledin the art without departing from the scope of the invention as recitedby the claims.

In various embodiments of the present invention, computing device 120can be a laptop computer, a tablet computer, a netbook computer, apersonal computer (PC), a desktop computer, a personal digital assistant(PDA), a smart phone, or any programmable electronic device capable ofexecuting computer readable program instructions. Computing device 120can be a server including a management server, a web server, or anyother electronic device or computing system capable of receiving andsending data.

Computing device 120 includes user interface (UI) 122, debuggervalidation program 124, compiler 126, debugger program 128, and sourceprogram files 130. In various embodiments of the present invention, oneor more of debugger validation program 124, compiler 126, debuggerprogram 128, and source program files 130 could be included within oneprogram. Computing device 120 may include internal and externalcomponents, as depicted and described in further detail with respect toFIG. 6.

UI 122 may be, for example, a graphical user interface (GUI) or a webuser interface (WUI), and can display text, documents, web browserwindows, user options, application interfaces, and instructions foroperation.

Source program files 130 are one or more computer language files, andmay include expressions that perform assignment, arithmetic, andcomparison, among other functions. In an embodiment of the presentinvention, source program files 130 are written in CommonBusiness-Oriented Language (COBOL) programming language. In otherembodiments of the present invention, source program files 130 may be asource program file(s) written in any suitable programming language.

Compiler 126 is a set of computer readable program instructions thatoperates to transform source program files 130 written in a programminglanguage into a computer executable language, or a computer code. In anillustrative embodiment of the present invention, the compiler-generatedcomputer code evaluates high level language expressions, such asassignment, arithmetic, and comparison, among other expressions.

Debugger program 128 operates to control the execution of a debuggableprogram and examine the state of the debuggable program in a variety ofways. Debugger program 128 allows a user to set breakpoints, stepthrough a set of program statements, jump around a set of programstatements, examine variables, and evaluate expressions, among otherfunctions. In an embodiment in accordance with the present invention,debugger program 128 supports automated program execution, so that aprogram may run solely under debug control using a series of scripteddebug commands. As a debug command file is executed by debugger program128, the debug command file output is saved in a log file.

Debugger validation program 124 operates generally to ensure that theexpression evaluation performed by debugger program 128 is correct.Debugger validation program 124 validates consistency between complexexpression evaluation performed by the compiler-generated code anddebugger program 128 involving arithmetic operators, logical operators,assignment, subscripting, member access, and literal values, among otherevaluations. Debugger validation program 124 scans source program files130, and causes the execution of a validation method involving thecompiler-generated code and debugger program 128. In an exampleembodiment in accordance with the present invention, debugger validationprogram 124 and debugger program 128 are stored on different devices andinteract with each other via a network.

FIG. 2 is a flowchart depicting operational steps of debugger validationprogram 124 for validating the correctness of expression evaluationwithin a debugger, in accordance with an embodiment of the presentinvention.

Debugger validation program 124 determines a source program file to scan(step 202). A user chooses a source program file, the program files thatdefine the data and the statements, for debugger validation program 124to scan. In one embodiment, COBOL language source files are the sourceprogram files chosen by a user. In another embodiment, the programsource files chosen by the user may be written in any suitableprogramming language so that debugger validation program 124 can scanthe program source files in order to validate debugger program 128support in evaluating expressions from the chosen programming language.

Source files that were originally written to test the compiler (i.e., acompiler test suite) could be reused here to also test the debugger.Such a compiler test suite would already have a comprehensive set oftest cases, which validate support of the compiler for all of theexpression types allowed by a programming language. The compiler testsuite is ideal for similarly testing the support of the debugger forexpression evaluation using a program methodology, in accordance with anembodiment of present invention. Every kind of expression and everycombination of data types that are covered by the compiler test cases(everything allowed by the programming language) will also be tested inthe debugger, and if the debugger and compiler-generated code each comesup with a different answer for any of the expressions, this will bedetected and flagged as an issue that needs to be resolved.

Debugger validation program 124 scans source program files 130 for aprogram statement of interest, which is a program statement thatcontains an expression of interest (step 204). In one embodiment, anexpression is of interest if it is supported by expression evaluationwithin debugger program 128. For example, debugger validation program124 is written in Perl programming language and uses pattern matchingwith regular expressions to discover statements of interest within aCOBOL source file. The statements MOVE, SET, COMPUTE, and IF arestatements of interest in COBOL language source files because debuggerprogram 128 supports commands which mimic these COBOL statements.

A COBOL program may also contain additional statements such as ADD,SUBTRACT, MULTIPLY, and DIVIDE, which perform arithmetic, similar to theCOMPUTE statement. Debugger validation program 124 can detect theadditional statements in the source files and convert the additionalstatements into the equivalent COMPUTE commands in the debug commandfile. The conversion of the additional statements into a COMPUTE commandpreserves the semantics, though the debugger may not support a commandwith the same name and syntax as the additional statement. This allowsthe additional statements to also be considered statements of interest,and be leveraged as additional input to the debugger validation process.FIG. 5A depicts an example of a COBOL source program file containing thestatements of interest MOVE, COMPUTE, ADD, SET, and IF.

In another embodiment in accordance with the present invention,statements of interest are identified using a COBOL parser, a softwarecomponent that analyzes the source code of a computer programminglanguage to create a form of internal representation, by reusing thesource code from compiler 126 to do the parsing.

Debugger validation program 124 generates a debug command file (step206). Responsive to scanning source program files 130, debuggervalidation program 124 automatically generates a debug command filebased on source program files 130 that are scanned. A debug command fileis a text file made up of a series of debug commands to be read andexecuted by debugger program 128. FIG. 5B depicts an example of a debugcommand file, generated from the COBOL source program file in FIG. 5A,for validating the correctness of the MOVE, COMPUTE, ADD, and SETcommands in debugger program 128. FIG. 5D depicts an example of a debugcommand file, generated from the COBOL source program file in FIG. 5A,for validating the correctness of the IF command in debugger program128. In one embodiment in accordance with the present invention, ifthere are changes to source program files 130, then the correspondingdebug command file is automatically regenerated to reflect that change.In another embodiment, compiler 126 can generate the debug command filebased on source program files 130 that are scanned.

Debugger validation program 124 generates debug commands and inserts thedebug commands into the debug command file for each statement ofinterest found in step 204 (step 208). In one embodiment, debuggervalidation program 124 gathers information to use when generating debugcommands for each statement of interest found in step 204. For example,information for each statement of interest may include: the fullstatement of interest text, the location of the statement of interestwithin the source file (line/statement number); the location of thestatement immediately following the statement of interest (regardless ofwhether or not that next statement is also a statement of interest); thelocation of the first statement within the true path, and false path foran IF statement; taking into account nested IF statements (described inmore detail below); and the name of the receiving variable in anassignment statement, or the sub-expression which denotes the target ofthe assignment which may involve member access, array indexing, pointerdereferencing, and arithmetic, among other operations.

Debugger validation program 124 inserts the appropriate set of debugcommands for each statement of interest in order to achieve the desiredbehavior during the baseline and test runs (discussed below). Responsiveto inserting the generated debug commands into the debug command file,the result is one command file containing debug commands for eachstatement of interest that is conditioned to execute a different set ofcommands during a baseline run and a test run. The debug commands setbreakpoints, evaluate expressions, list the values of receivingvariables (or sub-expressions), change the debuggable program resumepoint, and let the debuggable program run, among other things.

In another embodiment, debugger validation program 124 generates twoseparate debug command files, one for a baseline run and one for a testrun, each with the commands appropriate for the type of run being done.Debugger validation program 124 passes the baseline command file todebugger program 128 during a baseline run, and the test command file todebugger program 128 during a test run. In the same embodiment, it isnot required to generate and insert debug commands, which areconditioned to cause a different set of commands to be executed during abaseline run and a test run, into the debug command file.

Debugger validation program 124 causes debugger program 128 to execute abaseline run of the debuggable program (step 210). The debug commandfile contains logic for debugger program 128 to perform certain stepsduring a baseline run, in which the compiler-generated code executes thestatements containing the expressions of interest that are found insource program files 130. In one embodiment, debugger validation program124 prepends two additional debug commands to the debug command file,prior to causing the execution of a baseline run. The two additionaldebug commands define a debugger session variable, and set the debuggersession variable to a value which indicates that a baseline run is beingexecuted. A session variable is a variable that is defined using thedebugger command language, that exists only during the debug session inwhich the session variable is defined, and that may be referenced insubsequent commands within the debug command file.

As a result of the execution of the baseline run, a debug log file isoutput which shows the value of each receiving variable in eachstatement of interest, as depicted in FIG. 5C. In one embodiment, thereceiving variable value in the baseline log is calculated and stored bythe compiler-generated code in the debuggable program. For example, theCOBOL statements MOVE, SET, and COMPUTE each assign a resulting valueinto a variable when the compiler-generated code for those statements isexecuted. A detailed flowchart of step 210 is discussed below withreference to FIG. 3A. The COBOL statement IF is a conditional statementwhich does not assign a value to a receiving variable, and requires adifferent method to display the results of a baseline and test run(discussed below with reference to FIGS. 3C and 3D).

Debugger validation program 124 causes debugger program 128 to execute atest run (step 212). During the test run, the debug command file is runa second time in the debugger, and executes the test run path that wasgenerated within the debug command file. The debug command file containslogic for debugger program 128 to perform certain steps during a testrun, in which the debugger executes a command which mimics the statementcontaining the expressions of interest from source program files 130. Asa result of the execution of the test run, a debug log file is outputwhich shows the value of each receiving variable in each statement ofinterest, as depicted in FIG. 5C. In one embodiment, the receivingvariable value in the test run log is calculated and stored by debuggerprogram 128. A detailed flowchart of step 212 is discussed below withreference to FIG. 3B.

Debugger validation program 124 compares the baseline log to the testlog and reports any differences between the logs (step 214). In anembodiment in accordance with the present invention, debugger validationprogram 124 uses an automated process to compare the receiving variablevalues of the baseline and test run output logs to detect anydifferences between the values. Any differences that exist between theoutput logs are reported as a test case failure. If the two logs areequal, the compiler-generated code (baseline run) and debugger program128 (test run) achieved the same results and the test case is considereda pass. A difference in the baseline and test run output logs indicatesthat there are one or more defects in the debugger support forexpression evaluation that need to be corrected. For example, asdepicted in FIG. 5C, the values in the debug log files for the baselinerun and test run are the same, indicating that the debug commandsarrived at the same answer as the compiler-generated code for thestatements of interest.

FIG. 3A is a flowchart depicting the operational steps of debuggerprogram 128 for executing a baseline run using debug commands generatedfrom assignment statements in a debuggable program, in accordance withan embodiment of the present invention.

Debugger program 128 sets breakpoints at specific locations in thedebuggable program, relative to the statements of interest (step 310). Abreakpoint is an intentional stopping or pausing place in a computerprogram. In one embodiment, debugger program 128 sets breakpoints on thestatements immediately following each statement of interest. Forexample, a breakpoint is set for the statements following each MOVE,SET, or COMPUTE statement in COBOL programming language.

Debugger program 128 causes the debuggable program to run (step 311).Debugger program 128 executes the debuggable program by running thecompiler-generated code until a breakpoint is hit after a statement ofinterest.

Debugger program 128 determines whether a breakpoint was hit in thedebuggable program (decision block 312). If a breakpoint was not hit(decision block 312, No branch), debugger program 128 stops running andthe program exits. If a breakpoint was hit (decision block 312, Yesbranch), debugger program 128 causes the compiler-generated code toevaluate the expression and to store the results (step 313).

Debugger program 128 causes the compiler-generated code for a statementof interest to perform expression evaluation and to store the result ina receiving variable (step 313). In one embodiment, debugger program 128automatically executes the compiler-generated code to perform expressionevaluation for a statement of interest, once the statement of interestis reached in the program. For example, at the time the set breakpointhas been reached, the compiler-generated code to evaluate the MOVE, SET,or COMPUTE statement that immediately precedes the breakpoint will havealready been executed. As a result of the compiler-generated codeperforming expression evaluation, the resulting value is stored in areceiving variable.

Debugger program 128 prints the value of the receiving variable in a logfile (step 314). Responsive to the compiler-generated code performingexpression evaluation, the resulting stored value of the receivingvariable is displayed in a log file. Once debugger program 128 hasstopped running, a log file containing the values of each receivingvariable for each statement of interest will be printed (depicted inFIG. 5C). In one embodiment, the resulting value is written into abaseline log file. For example, when using Debug Tool, a commercialdebugger product, as a debugger, the LIST command writes the resultingvalues into a log file.

Optionally, the generated debug command file can list the values of thevariables using only hexadecimal digits without any additionalformatting. Listing the raw, unformatted storage value in this way aidsin catching errors in debugger program 128 support that may not beevident when using formatted values alone. For example, for some COBOLdata types there is more than one way to represent the sign of a value(positive or negative), and if debugger program 128 uses a differentrepresentation than compiler 126, this may result in discrepancies thatwould not be evident unless the raw, unformatted value of the storage isprinted in the log files, showing a difference in the internal signrepresentation.

Debugger program 128 continues to cause the debuggable program to run(step 311) until another breakpoint is hit (decision block 312, Yesbranch), or there are no more breakpoints and the program exits(decision block 312, No branch).

FIG. 3B is a flowchart depicting the operational steps of debuggerprogram 128 for executing a test run (step 212) using debug commandsgenerated from assignment statements in a debuggable program, inaccordance with an embodiment of the present invention.

Debugger program 128 sets breakpoints at specific locations in theprogram, relative to the statements of interest (step 320). In oneembodiment, debugger program 128 sets a breakpoint on every statement ofinterest. For example, a breakpoint is set on every MOVE, SET, orCOMPUTE statement in a COBOL programming language program.

Debugger program 128 causes the debuggable program to run (step 321).Debugger program 128 executes the debuggable program by running thecompiler-generated code, until a breakpoint is hit at a statement ofinterest, but does not execute the statement of interest. For example,as depicted in FIG. 4, debuggable program 410 is executed by running thecompiler-generated code 450 for miscellaneous (misc.) statements 430(statements that are not of interest), until breakpoint 470 is reached,right before statement of interest 440.

Debugger program 128 determines whether a breakpoint was hit in thedebuggable program (decision block 322). If a breakpoint was not hit(decision block 322, No branch), then debugger program 128 stops runningand the program exits. If a breakpoint was hit (decision block 322, Yesbranch), then debugger program 128 executes a debug command, identicalto the statement of interest (step 323).

Debugger program 128 executes a debug command that is identical to thestatement of interest (step 323). In one embodiment, responsive tohitting a breakpoint at a statement of interest in thecompiler-generated code, debugger program 128 automatically executes adebug command that is identical to the statement of interest in thedebuggable program. For example, as depicted in FIG. 4, debugger program128 executes debug command 460 “MOVE y TO x” in debug command file 420that is identical to statement of interest 440 “MOVE y TO x” indebuggable program 410.

Debugger program 128 performs expression evaluation and stores theresulting value in a receiving variable (step 324). In one embodiment,debugger program 128 automatically performs expression evaluation on thedebug command that is identical to the statement of interest in thedebuggable program, emulating the expression evaluation thecompiler-generated code would have performed for this statement.Responsive to debugger program 128 performing expression evaluation onthe statement of interest, the resulting value is stored in a receivingvariable.

Debugger program 128 prints the value of the receiving variable in a logfile (step 325). Responsive to debugger program 128 performingexpression evaluation, debugger program 128 displays the stored value ofthe receiving variable in a log file. Once debugger program 128 hasstopped running, a log file containing the values of each receivingvariable for each statement of interest will be printed (depicted inFIG. 5C). In one embodiment, the resulting value is written into a testlog file. For example, when using Debug Tool as a debugger, the LISTcommand writes the resulting values into a log file.

Debugger program 128 executes a debug command to bypass thecompiler-generated code for a statement of interest in the debuggableprogram (step 326). In one embodiment, debugger program 128 executes acommand to bypass the statement of interest in the debuggable program toensure that the expression is evaluated only one time by the debugger,and not a second time by the compiler-generated code in the debuggableprogram. For example, as depicted in FIG. 4, before allowing debuggableprogram 410 to continue running, debugger program 128 executes GOTOcommand 480 to bypass statement of interest 440 “MOVE y TO x” indebuggable program 410, as an equivalent debug command 460 “MOVE y TO x”was evaluated by debugger program 128. Allowing the expression to beevaluated again by the compiler-generated code, can have undesirableside effects.

Debugger program 128 continues to cause the debuggable program to run(step 321) until another breakpoint is hit (decision block 322, Yesbranch) or there are no more breakpoints and the program exits (decisionblock 322, No branch).

FIG. 3C is a flowchart depicting operational steps of debugger program128 for executing a baseline run (step 210) using debug commandsgenerated from IF statements in a debuggable program, in accordance withan embodiment of the present invention.

Debugger program 128 sets breakpoints at specific locations in theprogram, relative to the statements of interest (step 330). In oneembodiment, debugger program 128 sets breakpoints in the debuggableprogram at the first statement within the true path of an IF statementand the first statement within the false path, if there is a false path.For example, in COBOL programming language, the IF statement has aconditional expression that is evaluated. The set of statements betweenthe IF and the matching ELSE (or matching END-IF when there is no ELSE)are referred to as the true path because these are the statements thatwill be executed when the condition evaluates to true. When there is anassociated ELSE, the set of statements between the ELSE and thecorresponding END-IF are referred to as the false path because these arethe statements that will be executed when the condition evaluates tofalse. Debugger program 128 sets breakpoints on the first statementwithin these paths for all IF statements in the debuggable program,including nested ones.

Debugger program 128 causes the debuggable program to run (step 331). Inone embodiment, the compiler-generated code evaluates the conditionalexpression in the statement of interest, prior to reaching the setbreakpoint. For example, by executing the debuggable program, debuggerprogram 128 causes the compiler-generated code to evaluate theconditional expression in the IF statement, before the debuggableprogram reaches the set breakpoint in the true or false path.

Debugger program 128 causes the compiler-generated code for a statementof interest to evaluate the conditional expression (step 332). In oneembodiment, debugger program 128 automatically executes thecompiler-generated code to perform expression evaluation for a statementof interest, once the statement of interest is reached in the debuggableprogram.

Debugger program 128 determines whether a breakpoint was hit in thedebuggable program (decision block 333). If a breakpoint was not hit(decision block 333, No branch), debugger program 128 stops running andthe program exits. If a breakpoint was hit (decision block 333, Yesbranch), debugger program 128 outputs an indication in a log file ofwhich path was taken (step 334).

Debugger program 128 outputs an indication in a log file of which pathwas taken (step 334). In one embodiment, a LIST command is used tooutput an indication in a log file of whether the true path (conditionevaluated as true) or the false path (condition evaluated as false) wastaken, responsive to debugger program 128 hitting a set breakpoint. Forexample, as depicted in FIG. 5E, the compiler-generated code for theconditional expression in the IF statement produced a result of true.

Debugger program 128 continues to cause the debuggable program to run(step 331) until another breakpoint is hit (decision block 333, Yesbranch) or there are no more breakpoints and the program exits (decisionblock 333, No branch).

FIG. 3D is a flowchart depicting operational steps of debugger program128 for executing a test run (step 212) using debug commands generatedfrom IF statements in a debuggable program, in accordance with anembodiment of the present invention.

Debugger program 128 sets breakpoints at specific locations in theprogram, relative to the statements of interest (step 340). In oneembodiment, debugger program 128 sets breakpoints at each IF statementin a debuggable program. For example, a breakpoint is set at each IFstatement in the debuggable program in COBOL programming language.

Debugger program 128 causes the debuggable program to run (step 341).Debugger program 128 executes the debuggable program by running thecompiler-generated code until a breakpoint is hit.

Debugger program 128 determines whether a breakpoint was hit in thedebuggable program (decision block 342). If a breakpoint was not hit(decision block 342, No branch), then debugger program 128 stops runningand the program exits. If a breakpoint was hit (decision block 342, Yesbranch), then debugger program 128 executes an identical IF command inthe debug command file and evaluates the conditional expressionassociated with the identical IF command (step 343).

Debugger program 128 executes an identical IF command in the debugcommand file and evaluates the conditional expression associated withthat command (step 343). In one embodiment, responsive to hitting abreakpoint in the debuggable program, debugger program 128 automaticallyexecutes an IF command in the debug command file that is identical tothe IF statement that was executed by the compiler-generated code duringthe baseline run, and debugger program 128 evaluates the identicalconditional expression associated with that command.

Debugger program 128 outputs an indication in a log file of which pathwas taken within the debug command file, as a result of evaluating theconditional expression in the IF command (step 344). In one embodiment,a LIST command is used to output an indication in a log file of whetherthe true path (condition evaluated as true) or the false path (conditionevaluated as false) of the IF command was taken. The true path outputstring for the test run is identical to the true path output string ofthe baseline run, and the false path output string for the test run isidentical to the false path output string of the baseline run. Forexample, as depicted in FIG. 5E, the evaluation of the conditional IFstatement by debugger program 128 (test run) produced a result of true.A comparison of the output strings of the baseline run and the test runwill indicate whether debugger program 128 evaluated the conditionalexpression properly (baseline and test run outputs are identical), or ifthere was an error (baseline and test run outputs are different). Forexample, as depicted in FIG. 5E, both the compiler-generated code(baseline run) and debugger program 128 (test run) arrived at the sameoutput results for the statement of interest.

Debugger program 128 continues to cause the debuggable program to runthe compiler-generated code (step 341) until another breakpoint is hit(decision block 342, Yes branch) or there are no more breakpoints andthe program exits (decision block 342, No branch). In one embodiment,debugger program 128 causes the debuggable program to run thecompiler-generated code (step 341) and debugger program 128 causes thecompiler-generated code to execute the IF statement that was executed inthe debug command file in step 343, causing the debuggable program tofollow the true path or the false path (if there is one).

In an embodiment, debugger program 128 causes the compiler-generatedcode to evaluate the conditional expression that was evaluated bydebugger program 128 in step 343, so that the conditional expression isevaluated twice; one time by debugger program 128, and a second time bythe compiler-generated code in the debuggable program. In anotherembodiment, debugger program 128 causes the evaluation of theconditional expression in the debuggable program to be bypassed and onlyexecuted one time by debugger program 128. For example, in a languagewhere conditional expressions may be non-idempotent (such as C),evaluating an expression twice may have undesirable side effects thatwould negatively impact the remaining execution of the debuggableprogram. To evaluate an expression one time, debugger program 128executes a GOTO command so that when execution of the debuggable programresumes, it will be correctly positioned at the first statement withinthe true path of the IF statement, the first statement of the false pathof the IF statement (if there is one), or the first statement after thecorresponding END-IF.

FIG. 6 depicts a block diagram of components of computing device 120, inaccordance with an illustrative embodiment of the present invention. Itshould be appreciated that FIG. 6 provides only an illustration of oneimplementation and does not imply any limitations with regard to theenvironments in which different embodiments may be implemented. Manymodifications to the depicted environment may be made.

Computing device 120 includes communications fabric 602, which providescommunications between computer processor(s) 604, memory 606, persistentstorage 608, communications unit 610, and input/output (I/O)interface(s) 612. Communications fabric 602 can be implemented with anyarchitecture designed for passing data and/or control informationbetween processors (such as microprocessors, communications and networkprocessors, etc.), system memory, peripheral devices, and any otherhardware components within a system. For example, communications fabric602 can be implemented with one or more buses.

Memory 606 and persistent storage 608 are computer readable storagemedia. In this embodiment, memory 606 includes random access memory(RAM) 614 and cache memory 616. In general, memory 606 can include anysuitable volatile or non-volatile computer readable storage media.

User interface 122, debugger validation program 124, compiler 126,debugger program 128, and source program files 130 are stored inpersistent storage 608 for execution and/or access by one or more of therespective computer processors 604 via one or more memories of memory606. In this embodiment, persistent storage 608 includes a magnetic harddisk drive. Alternatively, or in addition to a magnetic hard disk drive,persistent storage 608 can include a solid state hard drive, asemiconductor storage device, read-only memory (ROM), erasableprogrammable read-only memory (EPROM), flash memory, or any othercomputer readable storage media that is capable of storing programinstructions or digital information.

The media used by persistent storage 608 may also be removable. Forexample, a removable hard drive may be used for persistent storage 608.Other examples include optical and magnetic disks, thumb drives, andsmart cards that are inserted into a drive for transfer onto anothercomputer readable storage medium that is also part of persistent storage608.

Communications unit 610, in these examples, provides for communicationswith other data processing systems or devices. In these examples,communications unit 610 includes one or more network interface cards.Communications unit 610 may provide communications through the use ofeither or both physical and wireless communications links. Userinterface 122, debugger validation program 124, compiler 126, debuggerprogram 128, and source program files 130 may be downloaded topersistent storage 608 through communications unit 610.

I/O interface(s) 612 allows for input and output of data with otherdevices that may be connected to computing device 120. For example, I/Ointerface 612 may provide a connection to external devices 618 such as akeyboard, keypad, a touch screen, and/or some other suitable inputdevice. External devices 618 can also include portable computer readablestorage media such as, for example, thumb drives, portable optical ormagnetic disks, and memory cards. Software and data used to practiceembodiments of the present invention, e.g., user interface 122, debuggervalidation program 124, compiler 126, debugger program 128, and sourceprogram files 130, can be stored on such portable computer readablestorage media and can be loaded onto persistent storage 608 via I/Ointerface(s) 612. I/O interface(s) 612 also connect to a display 620.Display 620 provides a mechanism to display data to a user and may be,for example, a computer monitor or an incorporated display screen, suchas is used in tablet computers and smart phones.

The programs described herein are identified based upon the applicationfor which they are implemented in a specific embodiment of theinvention. However, it should be appreciated that any particular programnomenclature herein is used merely for convenience, and thus theinvention should not be limited to use solely in any specificapplication identified and/or implied by such nomenclature.

The present invention may be a system, a method, and/or a computerprogram product. The computer program product may include a computerreadable storage medium (or media) having computer readable programinstructions thereon for causing a processor to carry out aspects of thepresent invention.

The computer readable storage medium can be a tangible device that canretain and store instructions for use by an instruction executiondevice. The computer readable storage medium may be, for example, but isnot limited to, an electronic storage device, a magnetic storage device,an optical storage device, an electromagnetic storage device, asemiconductor storage device, or any suitable combination of theforegoing. A non-exhaustive list of more specific examples of thecomputer readable storage medium includes the following: a portablecomputer diskette, a hard disk, a random access memory (RAM), aread-only memory (ROM), an erasable programmable read-only memory (EPROMor Flash memory), a static random access memory (SRAM), a portablecompact disc read-only memory (CD-ROM), a digital versatile disk (DVD),a memory stick, a floppy disk, a mechanically encoded device such aspunch-cards or raised structures in a groove having instructionsrecorded thereon, and any suitable combination of the foregoing. Acomputer readable storage medium, as used herein, is not to be construedas being transitory signals per se, such as radio waves or other freelypropagating electromagnetic waves, electromagnetic waves propagatingthrough a waveguide or other transmission media (e.g., light pulsespassing through a fiber-optic cable), or electrical signals transmittedthrough a wire.

Computer readable program instructions described herein can bedownloaded to respective computing/processing devices from a computerreadable storage medium or to an external computer or external storagedevice via a network, for example, the Internet, a local area network(LAN), a wide area network (WAN), and/or a wireless network. The networkmay comprise copper transmission cables, optical transmission fibers,wireless transmission, routers, firewalls, switches, gateway computersand/or edge servers. A network adapter card or network interface in eachcomputing/processing device receives computer readable programinstructions from the network and forwards the computer readable programinstructions for storage in a computer readable storage medium withinthe respective computing/processing device.

Computer readable program instructions for carrying out operations ofthe present invention may be assembler instructions,instruction-set-architecture (ISA) instructions, machine instructions,machine dependent instructions, microcode, firmware instructions,state-setting data, or either source code or object code written in anycombination of one or more programming languages, including an objectoriented programming language such as Smalltalk, C++ or the like, andconventional procedural programming languages, such as the “C”programming language or similar programming languages. The computerreadable program instructions may execute entirely on the user'scomputer, partly on the user's computer, as a stand-alone softwarepackage, partly on the user's computer and partly on a remote computer,or entirely on the remote computer or server. In the latter scenario,the remote computer may be connected to the user's computer through anytype of network, including a local area network (LAN) or a wide areanetwork (WAN), or the connection may be made to an external computer(for example, through the Internet using an Internet Service Provider).In some embodiments, electronic circuitry including, for example,programmable logic circuitry, field-programmable gate arrays (FPGA), orprogrammable logic arrays (PLA) may execute the computer readableprogram instructions by utilizing state information of the computerreadable program instructions to personalize the electronic circuitry,in order to perform aspects of the present invention

Aspects of the present invention are described herein with reference toflowchart illustrations and/or block diagrams of methods, apparatus(systems), and computer program products according to embodiments of theinvention. It will be understood that each block of the flowchartillustrations and/or block diagrams, and combinations of blocks in theflowchart illustrations and/or block diagrams, can be implemented bycomputer readable program instructions.

These computer readable program instructions may be provided to aprocessor of a general purpose computer, special purpose computer, orother programmable data processing apparatus to produce a machine, suchthat the instructions, which execute via the processor of the computeror other programmable data processing apparatus, create means forimplementing the functions/acts specified in the flowchart and/or blockdiagram block or blocks. These computer readable program instructionsmay also be stored in a computer readable storage medium that can directa computer, a programmable data processing apparatus, and/or otherdevices to function in a particular manner, such that the computerreadable storage medium having instructions stored therein comprises anarticle of manufacture including instructions which implement aspects ofthe function/act specified in the flowchart and/or block diagram blockor blocks.

The computer readable program instructions may also be loaded onto acomputer, other programmable data processing apparatus, or other deviceto cause a series of operational steps to be performed on the computer,other programmable apparatus or other device to produce a computerimplemented process, such that the instructions which execute on thecomputer, other programmable apparatus, or other device implement thefunctions/acts specified in the flowchart and/or block diagram block orblocks.

The flowchart and block diagrams in the Figures illustrate thearchitecture, functionality, and operation of possible implementationsof systems, methods, and computer program products according to variousembodiments of the present invention. In this regard, each block in theflowchart or block diagrams may represent a module, segment, or portionof instructions, which comprises one or more executable instructions forimplementing the specified logical function(s). In some alternativeimplementations, the functions noted in the block may occur out of theorder noted in the figures. For example, two blocks shown in successionmay, in fact, be executed substantially concurrently, or the blocks maysometimes be executed in the reverse order, depending upon thefunctionality involved. It will also be noted that each block of theblock diagrams and/or flowchart illustration, and combinations of blocksin the block diagrams and/or flowchart illustration, can be implementedby special purpose hardware-based systems that perform the specifiedfunctions or acts or carry out combinations of special purpose hardwareand computer instructions.

What is claimed is:
 1. A computer program product for validatingcorrectness of expression evaluation within a debugger program, thecomputer program product comprising: a non-transitory computer readablestorage medium and program instructions stored on the computer readablestorage medium, the program instructions comprising: programinstructions to determine a statement of interest within one or moresource program files of a debuggable program, wherein the statement ofinterest comprises an expression recognized by a debugger program;program instructions to generate a debug command file for the statementof interest; program instructions to insert a set of debug commands forthe statement of interest into the debug command file, wherein the setof debug commands comprises a first path for a baseline run and a secondpath for a test run; program instructions to cause the execution of thebaseline run and the test run; program instructions to compare resultsfrom the baseline run and results from the test run to determine if saidresults from the baseline run are equivalent to said results from thetest run; program instructions to store results from the baseline run asa first true path string or a first false path string; programinstructions to store results from the test run as a second true pathstring or a second false path string; and program instructions tocompare the first true path string or the first false path string of theresults from the baseline run to the second true path string or thesecond false path string of the results from the test run, to determineif the first true path string or the first false path string isequivalent to the second true path string or the second false pathstring.
 2. The computer program product of claim 1, wherein the programinstructions to compare results from the baseline run and results fromthe test run to determine if said results from the baseline run areequivalent to said results from the test run further comprises: programinstructions to store results from the baseline run as a first pluralityof values of receiving variables; program instructions to store resultsfrom the test run as a second plurality of values of receivingvariables; and program instructions to compare the first plurality ofvalues of receiving variables of the results from the baseline run tothe second plurality of values of receiving variables of the resultsfrom the test run, to determine if the first plurality of values areequivalent to the second plurality of values.
 3. The computer programproduct of claim 1, wherein program instructions to insert the set ofdebug commands that comprises the first path for the baseline runfurther comprises: program instructions to insert a command to set afirst breakpoint at a statement after the statement of interest in thedebuggable program, wherein the debuggable program is generated from theone or more source program files; program instructions to insert acommand to execute the debuggable program; and program instructions toinsert a command, in response to the debuggable program hitting thefirst breakpoint, to list a value of a receiving variable, associatedwith a result of the expression within the statement of interest, in abaseline log.
 4. The computer program product of claim 1, whereinprogram instructions to insert the set of debug commands that comprisesthe second path for the test run further comprises: program instructionsto insert a command to set a second breakpoint at the statement ofinterest in the debuggable program, wherein the debuggable program isgenerated from the one or more source program files; programinstructions to insert a command to execute the debuggable program;program instructions to insert a command, in response to the debuggableprogram hitting the second breakpoint, to execute a debug commandsubstantially identical to the statement of interest; programinstructions to insert a command to list a value of a receiving variableassociated with a result of the execution of the debug command that issubstantially identical to the statement of interest, in a test log;program instructions to insert a command to bypass the statement ofinterest in the debuggable program; and program instructions to insert acommand to resume execution of the debuggable program.
 5. The computerprogram product of claim 1, wherein program instructions to insert theset of debug commands that comprises the first path for the baseline runfurther comprises: program instructions to insert a command to set athird breakpoint at a first statement within a true path and a fourthbreakpoint at a first statement within a false path, in the debuggableprogram; program instructions to insert a command to execute thedebuggable program; program instructions to insert a command, inresponse to the debuggable program hitting the third breakpoint, to listan output associated with a true result of a conditional expression in abaseline log, wherein the output comprises a true path string; andprogram instructions to insert a command, in response to the debuggableprogram hitting the fourth breakpoint, to list an output associated witha false result of the conditional expression in a baseline log, whereinthe output comprises a false path string.
 6. The computer programproduct of claim 1, wherein program instructions to insert the set ofdebug commands that comprises the second path for the test run furthercomprises: program instructions to insert a command to set a fifthbreakpoint at the statement of interest, wherein the statement ofinterest contains a conditional expression, in the debuggable program;program instructions to insert a command to execute the debuggableprogram; program instructions to insert a command, in response to thedebuggable program hitting the fifth breakpoint, to execute a debugcommand substantially identical to the statement of interest containingthe conditional expression; program instructions to insert a command tolist an output associated with a true result of the debug commandsubstantially identical to the statement of interest containing theconditional expression in a test log, wherein the output comprises atrue path string; and program instructions to insert a command to listan output associated with a false result of the debug commandsubstantially identical to the statement of interest containing theconditional expression in a test log, wherein the output comprises afalse path string.
 7. A computer system for validating correctness ofexpression evaluation within a debugger program, the computer systemcomprising: one or more computer processors; one or more computerreadable storage media; program instructions stored on the one or morecomputer readable storage media for execution by at least one of the oneor more processors, the program instructions comprising: programinstructions to determine a statement of interest within one or moresource program files of a debuggable program, wherein the statement ofinterest comprises an expression recognized by a debugger program;program instructions to generate a debug command file for the statementof interest; program instructions to insert a set of debug commands forthe statement of interest into the debug command file, wherein the setof debug commands comprises a first path for a baseline run and a secondpath for a test run; program instructions to insert a command to set afirst breakpoint at a statement after the statement of interest in thedebuggable program, wherein the debuggable program is generated from theone or more source program files; program instructions to insert acommand to execute the debuggable program; program instructions toinsert a command, in response to the debuggable program hitting thefirst breakpoint, to list a value of a receiving variable associatedwith a result of the expression within the statement of interest, in abaseline log; program instructions to cause the execution of thebaseline run and the test run; and program instructions to compareresults from the baseline run and results from the test run to determineif said results from the baseline run are equivalent to said resultsfrom the test run.
 8. The computer system of claim 7, wherein programinstructions to insert the set of debug commands that comprises thesecond path for the test run further comprises: program instructions toinsert a command to set a second breakpoint at the statement of interestin the debuggable program, wherein the debuggable program is generatedfrom the one or more source program files; program instructions toinsert a command to execute the debuggable program; program instructionsto insert a command, in response to the debuggable program hitting thesecond breakpoint, to execute a debug command substantially identical tothe statement of interest; program instructions to insert a command tolist a value of a receiving variable associated with a result of theexecution of the debug command that is substantially identical to thestatement of interest, in a test log; program instructions to insert acommand to bypass the statement of interest in the debuggable program;and program instructions to insert a command to resume execution of thedebuggable program.
 9. The computer system of claim 7, wherein programinstructions to insert the set of debug commands that comprises thefirst path for the baseline run further comprises: program instructionsto insert a command to set a third breakpoint at a first statementwithin a true path and a fourth breakpoint at a first statement within afalse path, in the debuggable program; program instructions to insert acommand to execute the debuggable program; program instructions toinsert a command, in response to the debuggable program hitting thethird breakpoint, to list an output associated with a true result of aconditional expression in a baseline log, wherein the output comprises atrue path string; and program instructions to insert a command, inresponse to the debuggable program hitting the fourth breakpoint, tolist an output associated with a false result of the conditionalexpression in a baseline log, wherein the output comprises a false pathstring.
 10. The computer system of claim 7, wherein program instructionsto insert the set of debug commands that comprises the second path forthe test run further comprises: program instructions to insert a commandto set a fifth breakpoint at the statement of interest, wherein thestatement of interest contains a conditional expression, in thedebuggable program; program instructions to insert a command to executethe debuggable program; program instructions to insert a command, inresponse to the debuggable program hitting the fifth breakpoint, toexecute a debug command substantially identical to the statement ofinterest containing the conditional expression; program instructions toinsert a command to list an output associated with a true result of thedebug command substantially identical to the statement of interestcontaining the conditional expression in a test log, wherein the outputcomprises a true path string; and program instructions to insert acommand to list an output associated with a false result of the debugcommand substantially identical to the statement of interest containingthe conditional expression in a test log, wherein the output comprises afalse path string.